import http from "@/utils/http.js";

//修改用户信息
export const editUserInfo = (data) => {
  return http.post(`/user/manage/users/completeUserInfo`, data);
};


//获取手机号
export const getPhone = (data) => {
    return http.get(`/applet/wechat/getPhone`, data);
  };




//获取钱包余额
export const walletBalance = () => {
    return http.get(`/applet/wallet/walletBalance`);
};
  

//获取充值明细
export const rechargeRecordList = (data) => {
    return http.post(`/applet/wallet/rechargeRecordList`,{}, {params:data});
};
  


//获取消费明细
export const consumptionDetailsList = (data) => {
    return http.post(`/applet/wallet/consumptionDetailsList`, {},{params:data});
};
  


//充值
export const recharge = (data) => {
    return http.post(`/applet/wallet/recharge?amount=${data}`);
};
  

//开始充电
export const startCharging = (data) => {
    return http.post(`/applet/charging/startCharging`,data);
};

//结束充电
export const endCharging = (data) => {
    return http.get(`/applet/charging/endCharging`,data);
};
  
//充个电详情
export const chargingDetails = (data) => {
    return http.get(`/applet/charging/chargingDetails`,data);
};
  
  
//订单列表
export const orderList = (data) => {
    return http.get(`/applet/order/list`,data);
};

//根据id获取订单详细信息

export const orderQueryById = (data) => {
    return http.get(`/applet/order/queryById`,data);
};

//收藏列表
export const collectList = (data) => {
    return http.get(`/applet/collect/list`,data);
};

//新增收藏
export const collectAdd = (data) => {
    return http.post(`/applet/collect/add`,data,{params:data});
};

//取消收藏
export const collectCancel = (data) => {
    return http.post(`/applet/collect/cancel`,{},{params:data});
};


//修改用户信息
export const userUpdate = (data) => {
    return http.post({
        url: `/applet/user/update`,
        data: data,
        header: { 
            "Content-Type": "application/json;charset=UTF-8",
            "Authori-zation": data.token
         },    
    });
};


//判断充电状态
export const judgeIsStartCharging = (data) => {
    return http.get(`/applet/charging/judgeIsStartCharging`,data);
};

